<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>pandas | Python 数据分析学习目录</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../数据分析库的初步认识/Series创建.html" />
    
    
    <link rel="prev" href="../数据分析库的初步认识/index.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.1"
        data-chapter-title="pandas"
        data-filepath="数据分析库的初步认识/Pandas创建.md"
        data-basepath=".."
        data-revision="Wed Oct 24 2018 21:30:49 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        数据分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="Python数据分析序言/内容序言.html">
            
                
                    <a href="../Python数据分析序言/内容序言.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Python数据分析内容
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="python数据分析环境和工具/Python数据分析相关.html">
            
                
                    <a href="../python数据分析环境和工具/Python数据分析相关.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        python数据分析环境和工具
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="python数据分析环境和工具/1Python数据课程软件和环境安装.html">
            
                
                    <a href="../python数据分析环境和工具/1Python数据课程软件和环境安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        Python数据课程 软件和环境安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="python数据分析环境和工具/2python发行版.html">
            
                
                    <a href="../python数据分析环境和工具/2python发行版.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        python发行版
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="python数据分析环境和工具/5交互式编辑器-JupyterNotebook.html">
            
                
                    <a href="../python数据分析环境和工具/5交互式编辑器-JupyterNotebook.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        交互式编辑器-JupyterNotebook
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="python数据分析环境和工具/5.1Jupyter-notebook拓展应用.html">
            
                
                    <a href="../python数据分析环境和工具/5.1Jupyter-notebook拓展应用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.1.</b>
                        
                        Jupyter-notebook拓展应用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="python数据分析环境和工具/包和环境管理器：conda.html">
            
                
                    <a href="../python数据分析环境和工具/包和环境管理器：conda.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        包和环境管理器：conda
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="python数据分析环境和工具/pip和Virtualenv.html">
            
                
                    <a href="../python数据分析环境和工具/pip和Virtualenv.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.1.</b>
                        
                        pip和Virtualenv
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="python数据分析环境和工具/3Markdown.html">
            
                
                    <a href="../python数据分析环境和工具/3Markdown.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        标记语言：Markdown
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="python数据分析环境和工具/4Markdown语法.html">
            
                
                    <a href="../python数据分析环境和工具/4Markdown语法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.1.</b>
                        
                        Markdown语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5.2" data-path="python数据分析环境和工具/6Gitbook文档.html">
            
                
                    <a href="../python数据分析环境和工具/6Gitbook文档.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.2.</b>
                        
                        文档管理工具-Gitbook
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="数据分析库的初步认识/index.html">
            
                
                    <a href="../数据分析库的初步认识/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        数据分析库-Pandas
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="3.1" data-path="数据分析库的初步认识/Pandas创建.html">
            
                
                    <a href="../数据分析库的初步认识/Pandas创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        pandas
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="数据分析库的初步认识/Series创建.html">
            
                
                    <a href="../数据分析库的初步认识/Series创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        Series
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="数据分析库的初步认识/DataFrame创建.html">
            
                
                    <a href="../数据分析库的初步认识/DataFrame创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        DataFrame对象-创建
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" >
            
            <span><b>4.</b> 数据分析库的操作</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="数据分析库的操作/1DataFrame查询1-整体.html">
            
                
                    <a href="../数据分析库的操作/1DataFrame查询1-整体.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        DataFrame查询1-整体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="数据分析库的操作/2DataFrame查询2-专用查询.html">
            
                
                    <a href="../数据分析库的操作/2DataFrame查询2-专用查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        DataFrame查询2-专用查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html">
            
                
                    <a href="../数据分析库的操作/3DataFrame查询3-专有查询：过滤查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        DataFrame查询3-专有查询：过滤查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="数据分析库的操作/4Pandas对象的数据操作：增删改查.html">
            
                
                    <a href="../数据分析库的操作/4Pandas对象的数据操作：增删改查.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        Pandas对象的数据操作：增删改查
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="数据分析库的操作/5Pandas数据操作：其他操作.html">
            
                
                    <a href="../数据分析库的操作/5Pandas数据操作：其他操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.1.</b>
                        
                        Pandas数据操作：其他操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="数据分析库的操作/6Pandas数据存取.html">
            
                
                    <a href="../数据分析库的操作/6Pandas数据存取.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.2.</b>
                        
                        Pandas数据存取
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.3" data-path="数据分析库的操作/7Pandas数据运算.html">
            
                
                    <a href="../数据分析库的操作/7Pandas数据运算.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.</b>
                        
                        Pandas数据运算
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.3.1" data-path="数据分析库的操作/7.1Pandas数据运算拓展.html">
            
                
                    <a href="../数据分析库的操作/7.1Pandas数据运算拓展.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.1.</b>
                        
                        Pandas数据运算-拓展
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4.4" data-path="数据分析库的操作/8Pandas分组聚合1.html">
            
                
                    <a href="../数据分析库的操作/8Pandas分组聚合1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.4.</b>
                        
                        Pandas分组聚合1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.5" data-path="数据分析库的操作/9Pandas分组聚合2.html">
            
                
                    <a href="../数据分析库的操作/9Pandas分组聚合2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.5.</b>
                        
                        Pandas分组聚合2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.6" data-path="数据分析库的操作/10Pandas数据规整-清理.html">
            
                
                    <a href="../数据分析库的操作/10Pandas数据规整-清理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.6.</b>
                        
                        Pandas数据规整-清理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.7" data-path="数据分析库的操作/11Pandas数据规整-转换.html">
            
                
                    <a href="../数据分析库的操作/11Pandas数据规整-转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.7.</b>
                        
                        Pandas数据规整-转换
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.7.1" data-path="数据分析库的操作/14Pandas数据规整-转换-离散化和面元划分.html">
            
                
                    <a href="../数据分析库的操作/14Pandas数据规整-转换-离散化和面元划分.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.7.1.</b>
                        
                        离散化和面元划分
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4.8" data-path="数据分析库的操作/16Pandas数据规整-合并.html">
            
                
                    <a href="../数据分析库的操作/16Pandas数据规整-合并.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.8.</b>
                        
                        Pandas数据规整-合并
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="数据分析库的操作/13Pandas数据规整-重塑和轴向旋转.html">
            
                
                    <a href="../数据分析库的操作/13Pandas数据规整-重塑和轴向旋转.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        Pandas数据规整-重塑和轴向旋转
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.5.1" data-path="数据分析库的操作/13.1透视表和交叉表.html">
            
                
                    <a href="../数据分析库的操作/13.1透视表和交叉表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.1.</b>
                        
                        透视表和交叉表
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="Python可视化/绘图库-Matplotlib.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Python可视化
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="Python可视化/绘图库-Matplotlib/Matplotlib常见图表.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/Matplotlib常见图表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        基础：Matplotlib常见图表
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1.1" data-path="Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/Matplotlib常见设置和操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.1.</b>
                        
                        Matplotlib常见设置和操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="Python可视化/绘图库-Matplotlib/1Matplotlib-绘图区域.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/1Matplotlib-绘图区域.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        提升：绘图区域
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="Python可视化/绘图库-Matplotlib/2Matplotlib-图像组件.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/2Matplotlib-图像组件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        提升：绘图组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="Python可视化/绘图库-Matplotlib/3Matplotlib-高级绘图.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/3Matplotlib-高级绘图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        拓展：高级绘图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="Python可视化/绘图库-Matplotlib/4数学计算展示图像.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/4数学计算展示图像.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        拓展：数学计算展示图像
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="Python可视化/绘图库-Matplotlib/5注意事项.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/5注意事项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        拓展：注意事项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="Python可视化/绘图库-Matplotlib/6pylab.html">
            
                
                    <a href="../Python可视化/绘图库-Matplotlib/6pylab.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        拓展：pylab
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="数据分析必备知识点/数据分析必备知识点汇集.html">
            
                
                    <a href="../数据分析必备知识点/数据分析必备知识点汇集.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        数据分析必备知识点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7" data-path="数据分析必备知识点/数据分析流程.html">
            
                
                    <a href="../数据分析必备知识点/数据分析流程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        数据分析流程
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Python 数据分析学习目录</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="pandas-&#x4F53;&#x9A8C;">Pandas &#x4F53;&#x9A8C;</h1>
<hr>
<p>Pandas(panel data &amp; Data Analysis)&#xFF1A;&#x6700;&#x6D41;&#x884C;&#x7684;Python&#x6570;&#x636E;&#x5206;&#x6790;&#x5E93;&#x3002;</p>
<p>&#x57FA;&#x4E8E;Numpy&#xFF0C;&#x4E13;&#x7528;&#x4E8E;<strong>&#x6570;&#x636E;&#x9884;&#x5904;&#x7406;</strong>&#x548C;<strong>&#x6570;&#x636E;&#x5206;&#x6790;</strong>&#x7684;Python&#x7B2C;&#x4E09;&#x65B9;&#x5E93;&#xFF0C;&#x6700;&#x9002;&#x5408;&#x5904;&#x7406;&#x5927;&#x578B;&#x7ED3;&#x6784;&#x5316;<strong>&#x8868;&#x683C;&#x6570;&#x636E;</strong></p>
<hr>
<h2 id="pandas-&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;">Pandas &#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;</h2>
<ul>
<li>Series &#x4E00;&#x7EF4;&#xFF0C;&#x5E26;&#x6807;&#x7B7E;&#x6570;&#x7EC4;</li>
<li>DataFrame &#x4E8C;&#x7EF4;&#xFF0C;Series&#x5BB9;&#x5668;&#xFF08;&#x6700;&#x5E38;&#x7528;&#xFF09;</li>
<li>Panel &#x4E09;&#x7EF4;&#xFF0C;DataFrame&#x5BB9;&#x5668;</li>
</ul>
<p>%%HTML</p>
<p><script>
code_show=true;
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
}
$( document ).ready(code_toggle);
</script></p>
<form action="javascript:code_toggle()"><input type="submit" value="&#x70B9;&#x51FB;&#x6309;&#x94AE;&#x663E;&#x793A;/&#x9690;&#x85CF;&#x6587;&#x6863;&#x4EE3;&#x7801;&#xFF01;"></form>

<h3 id="&#x8F7D;&#x5165;pandas-&#x5E93;">&#x8F7D;&#x5165;pandas &#x5E93;</h3>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
</code></pre>
<h2 id="series">Series</h2>
<pre><code class="lang-python">pd.Series([<span class="hljs-number">3</span>,<span class="hljs-number">5</span>,<span class="hljs-number">8</span>,<span class="hljs-number">111</span>,<span class="hljs-number">222</span>])
</code></pre>
<pre><code>0      3
1      5
2      8
3    111
4    222
dtype: int64
</code></pre><pre><code class="lang-python">pd.Series([<span class="hljs-number">3</span>,<span class="hljs-number">5</span>,<span class="hljs-number">8</span>,<span class="hljs-number">11</span>,<span class="hljs-number">22</span>],index = [<span class="hljs-string">&apos;aa&apos;</span>,<span class="hljs-string">&apos;bb&apos;</span>,<span class="hljs-string">&apos;cc&apos;</span>,<span class="hljs-string">&apos;dd&apos;</span>,<span class="hljs-string">&apos;ee&apos;</span>])
</code></pre>
<pre><code>aa     3
bb     5
cc     8
dd    11
ee    22
dtype: int64
</code></pre><pre><code class="lang-python">pd.Series([<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>],index = [<span class="hljs-string">&apos;66&apos;</span>,<span class="hljs-string">&apos;77&apos;</span>,<span class="hljs-string">&apos;88&apos;</span>,<span class="hljs-string">&apos;99&apos;</span>,<span class="hljs-string">&apos;00&apos;</span>,<span class="hljs-string">&apos;44&apos;</span>])
</code></pre>
<pre><code>66    1
77    2
88    3
99    4
00    5
44    6
dtype: int64
</code></pre><h2 id="dataframe">DataFrame</h2>
<pre><code class="lang-python">pd.DataFrame([[<span class="hljs-number">2</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>],[<span class="hljs-number">3</span>,<span class="hljs-number">8</span>,<span class="hljs-number">4</span>,<span class="hljs-number">2</span>]])
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>0</th>
      <th>1</th>
      <th>2</th>
      <th>3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>2</td>
      <td>5</td>
      <td>6</td>
      <td>7</td>
    </tr>
    <tr>
      <th>1</th>
      <td>3</td>
      <td>8</td>
      <td>4</td>
      <td>2</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">pd.DataFrame([[<span class="hljs-number">2</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>],[<span class="hljs-number">3</span>,<span class="hljs-number">8</span>,<span class="hljs-number">4</span>,<span class="hljs-number">2</span>]],
            index = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>],
            columns = [<span class="hljs-string">&apos;aa&apos;</span>,<span class="hljs-string">&apos;bb&apos;</span>,<span class="hljs-string">&apos;cc&apos;</span>,<span class="hljs-string">&apos;dd&apos;</span>])
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>aa</th>
      <th>bb</th>
      <th>cc</th>
      <th>dd</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>2</td>
      <td>5</td>
      <td>6</td>
      <td>7</td>
    </tr>
    <tr>
      <th>2</th>
      <td>3</td>
      <td>8</td>
      <td>4</td>
      <td>2</td>
    </tr>
  </tbody>
</table>
</div>




<pre><code class="lang-python">pd.DataFrame([[<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>],[<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,<span class="hljs-number">7</span>,<span class="hljs-number">8</span>]],
            index = [<span class="hljs-string">&apos;a&apos;</span>,<span class="hljs-string">&apos;b&apos;</span>],
            columns = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,<span class="hljs-number">4</span>])
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>1</th>
      <th>2</th>
      <th>3</th>
      <th>4</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>a</th>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
    </tr>
    <tr>
      <th>b</th>
      <td>5</td>
      <td>6</td>
      <td>7</td>
      <td>8</td>
    </tr>
  </tbody>
</table>
</div>



<hr>
<h2 id="&#x62BD;&#x8C61;&#x548C;&#x7EF4;&#x5EA6;">&#x62BD;&#x8C61;&#x548C;&#x7EF4;&#x5EA6;</h2>
<p>===</p>
<p>12&#x671F;&#x540C;&#x5B66;&#x6570;&#x636E;</p>
<pre><code class="lang-python"><span class="hljs-string">&apos;&#x738B;&#x707F;&#xFF0C;18,177.5,75&#xFF0C;True&apos;</span>
<span class="hljs-string">&apos;&#x5218;&#x53CC;&#x4E39;&#xFF0C;28,168.2,45&#xFF0C;False&apos;</span>
<span class="hljs-string">&apos;&#x7FDF;&#x9E4F;&#x98DE;&#xFF0C;38,85,180.2&#xFF0C;True&apos;</span>
</code></pre>
<pre><code>&apos;&#x7FDF;&#x9E4F;&#x98DE;&#xFF0C;38,85,180.2&#xFF0C;True&apos;
</code></pre><h1 id="&#x7535;&#x5B50;&#x8868;&#x683C;">&#x7535;&#x5B50;&#x8868;&#x683C;</h1>
<pre><code>&#x59D3;&#x540D; | &#x5E74;&#x9F84; | &#x8EAB;&#x9AD8; | &#x6027;&#x522B;
---- | ---- | ---- | ----
&#x738B;&#x707F; | 18 | 177.5 | True
&#x5218;&#x53CC;&#x4E39; | 28 | 168.5 | False
&#x7FDF;&#x9E4F;&#x98DE; | 38 | 180.5 | True
</code></pre><table>
<thead>
<tr>
<th>&#x59D3;&#x540D;</th>
<th>&#x5E74;&#x9F84;</th>
<th>&#x8EAB;&#x9AD8;</th>
<th>&#x6027;&#x522B;</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x738B;&#x707F;</td>
<td>18</td>
<td>177.5</td>
<td>True</td>
</tr>
<tr>
<td>&#x5218;&#x53CC;&#x4E39;</td>
<td>28</td>
<td>168.5</td>
<td>False</td>
</tr>
<tr>
<td>&#x7FDF;&#x9E4F;&#x98DE;</td>
<td>38</td>
<td>180.5</td>
<td>True</td>
</tr>
</tbody>
</table>
<p>&#x62BD;&#x8C61;&#x6210;python &#x80FD;&#x5904;&#x7406;&#x7684;&#x6570;&#x636E;</p>
<p>0&#x7EF4; &#xFF0C; &#x6807;&#x91CF;</p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x53D8;&#x91CF;,112 &#x4E2A;</span>
name = <span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>
age = <span class="hljs-number">18</span>
height = <span class="hljs-number">177.6</span>
gender = <span class="hljs-keyword">True</span>
</code></pre>
<p>1 &#x7EF4;&#xFF0C;&#x77E2;&#x91CF; &#xFF08;&#x5411;&#x91CF;&#xFF09;</p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x5217;&#x8868; &#xFF0C;4 &#x4E2A;</span>
name = [<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,<span class="hljs-string">&apos;&#x5218;&#x53CC;&#x4E39;&apos;</span>,<span class="hljs-string">&apos;&#x7FDF;&#x9E4F;&#x98DE;&apos;</span>]
age = [<span class="hljs-number">18</span>,<span class="hljs-number">28</span>,<span class="hljs-number">38</span>]
height = [<span class="hljs-number">177.5</span>,<span class="hljs-number">168.6</span>,<span class="hljs-number">180.2</span>]
gender = [<span class="hljs-keyword">True</span>,<span class="hljs-keyword">False</span>,<span class="hljs-keyword">True</span>]
</code></pre>
<pre><code class="lang-python"><span class="hljs-comment"># &#x5B57;&#x5178; ,3 &#x4E2A;&#x3002;</span>
wangcan = {
    <span class="hljs-string">&apos;name&apos;</span>:<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,
    <span class="hljs-string">&apos;age&apos;</span>:<span class="hljs-number">18</span>,
    <span class="hljs-string">&apos;height&apos;</span>:<span class="hljs-number">170.5</span>,
    <span class="hljs-string">&apos;gender&apos;</span>:<span class="hljs-keyword">True</span>,
}
</code></pre>
<p>2&#x7EF4;&#xFF0C; &#x77E9;&#x9635; </p>
<pre><code class="lang-python"><span class="hljs-comment"># &#x5D4C;&#x5957; 1 &#x4E2A;</span>
py12 = {
    <span class="hljs-string">&apos;name&apos;</span> : [<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,<span class="hljs-string">&apos;&#x5218;&#x53CC;&#x4E39;&apos;</span>,<span class="hljs-string">&apos;&#x7FDF;&#x9E4F;&#x98DE;&apos;</span>],
    <span class="hljs-string">&apos;age&apos;</span> : [<span class="hljs-number">18</span>,<span class="hljs-number">28</span>,<span class="hljs-number">38</span>],
    <span class="hljs-string">&apos;height&apos;</span> : [<span class="hljs-number">177.5</span>,<span class="hljs-number">168.6</span>,<span class="hljs-number">180.2</span>],
    <span class="hljs-string">&apos;gender&apos;</span> : [<span class="hljs-keyword">True</span>,<span class="hljs-keyword">False</span>,<span class="hljs-keyword">True</span>],
}
py12
</code></pre>
<pre><code>{&apos;name&apos;: [&apos;&#x738B;&#x707F;&apos;, &apos;&#x5218;&#x53CC;&#x4E39;&apos;, &apos;&#x7FDF;&#x9E4F;&#x98DE;&apos;],
 &apos;age&apos;: [18, 28, 38],
 &apos;height&apos;: [177.5, 168.6, 180.2],
 &apos;gender&apos;: [True, False, True]}
</code></pre><p>3 &#x7EF4;&#xFF0C; &#x5F20;&#x91CF;&#xFF0C;(tensor:3 &#x7EF4;&#x53CA;&#x4EE5;&#x4E0A;) </p>
<pre><code class="lang-python">py = {
    <span class="hljs-string">&apos;py12&apos;</span>:{
         <span class="hljs-string">&apos;name&apos;</span> : [<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,<span class="hljs-string">&apos;&#x5218;&#x53CC;&#x4E39;&apos;</span>,<span class="hljs-string">&apos;&#x7FDF;&#x9E4F;&#x98DE;&apos;</span>],
        <span class="hljs-string">&apos;age&apos;</span> : [<span class="hljs-number">18</span>,<span class="hljs-number">28</span>,<span class="hljs-number">38</span>],
        <span class="hljs-string">&apos;height&apos;</span> : [<span class="hljs-number">177.5</span>,<span class="hljs-number">168.6</span>,<span class="hljs-number">180.2</span>],
        <span class="hljs-string">&apos;gender&apos;</span> : [<span class="hljs-keyword">True</span>,<span class="hljs-keyword">False</span>,<span class="hljs-keyword">True</span>],
    },
    <span class="hljs-string">&apos;py13&apos;</span>:{
         <span class="hljs-string">&apos;name&apos;</span> : [<span class="hljs-string">&apos;&#x767D;&#x96EA;&#x539F;&apos;</span>,<span class="hljs-string">&apos;&#x674E;&#x5C27;&apos;</span>,<span class="hljs-string">&apos;&#xFF0C;&#x5B5F;&#x5BAA;&#x5CB3;&apos;</span>],
        <span class="hljs-string">&apos;age&apos;</span> : [<span class="hljs-number">18</span>,<span class="hljs-number">28</span>,<span class="hljs-number">38</span>],
        <span class="hljs-string">&apos;height&apos;</span> : [<span class="hljs-number">177.5</span>,<span class="hljs-number">168.6</span>,<span class="hljs-number">180.2</span>],
        <span class="hljs-string">&apos;gender&apos;</span> : [<span class="hljs-keyword">True</span>,<span class="hljs-keyword">False</span>,<span class="hljs-keyword">True</span>],
    }
}
py
</code></pre>
<pre><code>{&apos;py12&apos;: {&apos;name&apos;: [&apos;&#x738B;&#x707F;&apos;, &apos;&#x5218;&#x53CC;&#x4E39;&apos;, &apos;&#x7FDF;&#x9E4F;&#x98DE;&apos;],
  &apos;age&apos;: [18, 28, 38],
  &apos;height&apos;: [177.5, 168.6, 180.2],
  &apos;gender&apos;: [True, False, True]},
 &apos;py13&apos;: {&apos;name&apos;: [&apos;&#x767D;&#x96EA;&#x539F;&apos;, &apos;&#x674E;&#x5C27;&apos;, &apos;&#xFF0C;&#x5B5F;&#x5BAA;&#x5CB3;&apos;],
  &apos;age&apos;: [18, 28, 38],
  &apos;height&apos;: [177.5, 168.6, 180.2],
  &apos;gender&apos;: [True, False, True]}}
</code></pre><h2 id="&#x4F8B;&#xFF1A;&#x5C06;&#x56FE;&#x7247;&#x62BD;&#x8C61;&#x4E3A;&#x4E8C;&#x7EF4;&#x5217;&#x8868;&#x6570;&#x636E;">&#x4F8B;&#xFF1A;&#x5C06;&#x56FE;&#x7247;&#x62BD;&#x8C61;&#x4E3A;&#x4E8C;&#x7EF4;&#x5217;&#x8868;&#x6570;&#x636E;</h2>
<pre><code class="lang-python"><span class="hljs-comment"># &#x9ED1;&#x767D;&#x56FE;&#x50CF;,&#x7070;&#x5EA6;&#xFF0C;1 &#x7EF4;</span>
[
    <span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>,
    <span class="hljs-number">4</span>,<span class="hljs-number">5</span>,<span class="hljs-number">6</span>,
    <span class="hljs-number">7</span>,<span class="hljs-number">8</span>,<span class="hljs-number">9</span>,
]

<span class="hljs-comment">#&#x5F69;&#x8272;&#x56FE;&#x50CF; &#xFF0C;RGB&#x989C;&#x8272;&#xFF0C;2 &#x7EF4;</span>

[
    [<span class="hljs-number">255</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>],
    [<span class="hljs-number">0</span>,<span class="hljs-number">255</span>,<span class="hljs-number">0</span>],
    [<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">255</span>],
    [<span class="hljs-number">255</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>],
    [<span class="hljs-number">255</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>],
    [<span class="hljs-number">0</span>,<span class="hljs-number">255</span>,<span class="hljs-number">0</span>],
    [<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">255</span>],
    [<span class="hljs-number">255</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>],
]

[[<span class="hljs-number">255</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>],[<span class="hljs-number">0</span>,<span class="hljs-number">255</span>,<span class="hljs-number">0</span>],[<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">255</span>],[<span class="hljs-number">255</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>],[<span class="hljs-number">255</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>],[<span class="hljs-number">0</span>,<span class="hljs-number">255</span>,<span class="hljs-number">0</span>],[<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">255</span>],[<span class="hljs-number">255</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>]]
</code></pre>
<h1 id="pandas&#x62BD;&#x8C61;&#x8868;&#x683C;&#x6570;&#x636E;">Pandas&#x62BD;&#x8C61;&#x8868;&#x683C;&#x6570;&#x636E;</h1>
<table>
<thead>
<tr>
<th>&#x59D3;&#x540D;</th>
<th>&#x5E74;&#x9F84;</th>
<th>&#x8EAB;&#x9AD8;</th>
<th>&#x6027;&#x522B;</th>
</tr>
</thead>
<tbody>
<tr>
<td>&#x738B;&#x707F;</td>
<td>18</td>
<td>177.5</td>
<td>True</td>
</tr>
<tr>
<td>&#x5218;&#x53CC;&#x4E39;</td>
<td>28</td>
<td>168.5</td>
<td>False</td>
</tr>
<tr>
<td>&#x7FDF;&#x9E4F;&#x98DE;</td>
<td>38</td>
<td>180.5</td>
<td>True</td>
</tr>
</tbody>
</table>
<h1 id="series1-&#x7EF4;">Series,1 &#x7EF4;</h1>
<pre><code class="lang-python">
pd.Series([<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,<span class="hljs-string">&apos;&#x5218;&#x53CC;&#x4E39;&apos;</span>,<span class="hljs-string">&apos;&#x7FDF;&#x9E4F;&#x98DE;&apos;</span>])
pd.Series([<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,<span class="hljs-number">18</span>,<span class="hljs-number">177</span>,<span class="hljs-keyword">True</span>])
</code></pre>
<pre><code>0      &#x738B;&#x707F;
1      18
2     177
3    True
dtype: object
</code></pre><h1 id="&#x4FEE;&#x6539;series-&#x7D22;&#x5F15;">&#x4FEE;&#x6539;Series &#x7D22;&#x5F15;</h1>
<pre><code class="lang-python">
pd.Series([<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,<span class="hljs-number">18</span>,<span class="hljs-number">177</span>,<span class="hljs-keyword">True</span>],index=[<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;age&apos;</span>,<span class="hljs-string">&apos;height&apos;</span>,<span class="hljs-string">&apos;gender&apos;</span>])
</code></pre>
<pre><code>name        &#x738B;&#x707F;
age         18
height     177
gender    True
dtype: object
</code></pre><h1 id="dataframe-2-&#x7EF4;">DataFrame, 2 &#x7EF4;</h1>
<pre><code class="lang-python">
pd.DataFrame([
    [<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,<span class="hljs-number">18</span>,<span class="hljs-number">177</span>,<span class="hljs-keyword">True</span>],
    [<span class="hljs-string">&apos;&#x5218;&#x53CC;&#x4E39;&apos;</span>,<span class="hljs-number">16</span>,<span class="hljs-number">168</span>,<span class="hljs-keyword">False</span>],
    [<span class="hljs-string">&apos;&#x7FDF;&#x9E4F;&#x98DE;&apos;</span>,<span class="hljs-number">28</span>,<span class="hljs-number">178</span>,<span class="hljs-keyword">True</span>],
])
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>0</th>
      <th>1</th>
      <th>2</th>
      <th>3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>&#x738B;&#x707F;</td>
      <td>18</td>
      <td>177</td>
      <td>True</td>
    </tr>
    <tr>
      <th>1</th>
      <td>&#x5218;&#x53CC;&#x4E39;</td>
      <td>16</td>
      <td>168</td>
      <td>False</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x7FDF;&#x9E4F;&#x98DE;</td>
      <td>28</td>
      <td>178</td>
      <td>True</td>
    </tr>
  </tbody>
</table>
</div>



<h1 id="dataframe-2-&#x7EF4;&#x4FEE;&#x6539;&#x884C;&#x7D22;&#x5F15;&#xFF0C;&#x5217;&#x7D22;&#x5F15;&#x3002;">DataFrame, 2 &#x7EF4;,&#x4FEE;&#x6539;&#x884C;&#x7D22;&#x5F15;&#xFF0C;&#x5217;&#x7D22;&#x5F15;&#x3002;</h1>
<pre><code class="lang-python">
pd.DataFrame([
    [<span class="hljs-string">&apos;&#x738B;&#x707F;&apos;</span>,<span class="hljs-number">18</span>,<span class="hljs-number">177</span>,<span class="hljs-keyword">True</span>],
    [<span class="hljs-string">&apos;&#x5218;&#x53CC;&#x4E39;&apos;</span>,<span class="hljs-number">16</span>,<span class="hljs-number">168</span>,<span class="hljs-keyword">False</span>],
    [<span class="hljs-string">&apos;&#x7FDF;&#x9E4F;&#x98DE;&apos;</span>,<span class="hljs-number">28</span>,<span class="hljs-number">178</span>,<span class="hljs-keyword">True</span>],
],
    index = [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">3</span>],
    columns = [<span class="hljs-string">&apos;name&apos;</span>,<span class="hljs-string">&apos;age&apos;</span>,<span class="hljs-string">&apos;height&apos;</span>,<span class="hljs-string">&apos;gender&apos;</span>],
)
</code></pre>
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>name</th>
      <th>age</th>
      <th>height</th>
      <th>gender</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>1</th>
      <td>&#x738B;&#x707F;</td>
      <td>18</td>
      <td>177</td>
      <td>True</td>
    </tr>
    <tr>
      <th>2</th>
      <td>&#x5218;&#x53CC;&#x4E39;</td>
      <td>16</td>
      <td>168</td>
      <td>False</td>
    </tr>
    <tr>
      <th>3</th>
      <td>&#x7FDF;&#x9E4F;&#x98DE;</td>
      <td>28</td>
      <td>178</td>
      <td>True</td>
    </tr>
  </tbody>
</table>
</div>



                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../数据分析库的初步认识/index.html" class="navigation navigation-prev " aria-label="Previous page: 数据分析库-Pandas"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../数据分析库的初步认识/Series创建.html" class="navigation navigation-next " aria-label="Next page: Series"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
